package co.fitstart.weapp.api.service;

import java.util.Date;
import java.util.List;
import java.util.Map;

import co.fitstart.entity.course.ResultReport;
import co.fitstart.entity.course.round.CourseRound;
import co.fitstart.entity.course.round.Goal;
import co.fitstart.entity.course.schedule.CourseSchedule;
import co.fitstart.entity.courseware.CoursewareTag;
import co.fitstart.entity.courseware.assessment.BasicData;
import co.fitstart.entity.courseware.assessment.PostureJoint;
import co.fitstart.entity.courseware.assessment.StudentAssessment;
import co.fitstart.entity.courseware.assessment.StudentHabit;
import co.fitstart.entity.courseware.dietary.Dietary;
import co.fitstart.entity.courseware.dietary.DietaryProgram;
import co.fitstart.entity.courseware.dietary.DietaryProgramTemplate;
import co.fitstart.entity.courseware.dietary.DietaryProgramType;
import co.fitstart.entity.courseware.exercise.Exercise;
import co.fitstart.entity.courseware.exercise.ExerciseContent;
import co.fitstart.entity.courseware.exercise.PlannedSchedule;
import co.fitstart.entity.courseware.fitnessgroup.BatchCourseware;
import co.fitstart.entity.courseware.fitnessgroup.Courseware;
import co.fitstart.entity.courseware.fitnessgroup.CoursewareMovementType;
import co.fitstart.entity.courseware.fitnessgroup.DailyCourseware;
import co.fitstart.entity.courseware.fitnessgroup.FitnessGroup;
import co.fitstart.entity.principal.Principal;
import co.fitstart.entity.user.Student;
import co.fitstart.entity.user.basic.BodyDataTarget;
import co.fitstart.weapp.api.entity.CoursewareRequest;
import co.fitstart.weapp.api.entity.DietaryRequest;
import co.fitstart.weapp.api.entity.ExerciseRequest;

/**
 * 
 * @author haiyan_xiao
 *
 */
public interface CoursewareService {

    /**
     * 
     * @param courseSchedule
     * @return
     */
    public int getSession(CourseSchedule courseSchedule);

    /**
     * 
     * @param courseRound
     * @param session
     * @return
     */
    public PlannedSchedule getPlannedSchedule(CourseRound courseRound, int session);

    /**
     * 
     * @param courseSchedule
     * @return
     */
    public List<Courseware> listCourseware(CourseSchedule courseSchedule);

    /**
     * 组数、每组次数不为空的上课课件
     * @param courseSchedule
     * @return
     */
    public List<Courseware> listGeneratedCourseware(CourseSchedule courseSchedule);

    /**
     * 已发送周计划
     * @param courseRound
     * @return
     */
    public List<BatchCourseware> listWeeklyPlan(CourseRound courseRound);

    /**
     * 
     * @param courseRound
     * @return
     */
    public List<BatchCourseware> generallyListWeeklyPlan(CourseRound courseRound);

    /**
     * 所有周计划
     * @param courseRound
     * @return
     */
    public List<BatchCourseware> listAllWeeklyPlan(CourseRound courseRound);

    /**
     * 
     * @param courseRound
     * @return
     */
    public List<BatchCourseware> generallyListAllWeeklyPlan(CourseRound courseRound);

    /**
     * 
     * @param batchCoursewareId
     * @return
     */
    public BatchCourseware loadBatchCourseware(Long batchCoursewareId);

    /**
     * 
     * @param batchCourseware
     * @return
     */
    public Map<String, DietaryProgram> listDietary(BatchCourseware batchCourseware);

    /**
     * 
     * @param tagIds
     * @return
     */
    public List<CoursewareTag> listCoursewareTags(List<Long> tagIds);

    /**
     * 
     * @param dailyCoursewareId
     * @return
     */
    public DailyCourseware loadDailyCourseware(Long dailyCoursewareId);

    /**
     * 
     * @param dailyCourseware
     * @param type
     * @return
     */
    public List<Courseware> listCourseware(DailyCourseware dailyCourseware, CoursewareMovementType type);

    /**
     * 
     * @param coursewareId
     * @return
     */
    public Courseware loadCourseware(Long coursewareId);

    /**
     * 
     * @param courseRound
     * @return
     */
    public Goal loadGoal(CourseRound courseRound);

    /**
     * 
     * @param courseRound
     * @return
     */
    public List<BodyDataTarget> listBodyDataTarget(CourseRound courseRound);
    
    /**
     * 
     * @param courseRound
     * @return
     */
    public List<StudentAssessment> listStudentAssessment(CourseRound courseRound);
    
    /**
     * 
     * @param studentAssessmentId
     * @return
     */
    public StudentAssessment loadStudentAssessment(Long studentAssessmentId);
    
    /**
     * 
     * @param courseRound
     * @return
     */
    public StudentAssessment loadStudentAssessment(CourseRound courseRound);

    /**
     * 
     * @param courseRound
     * @return
     */
    public BasicData loadBasicData(CourseRound courseRound);

    /**
     * 
     * @param courseRound
     * @return
     */
    public StudentHabit loadStudentHabit(CourseRound courseRound);

    /**
     * 
     * @param courseRound
     * @return
     */
    public PostureJoint loadPostureJoint(CourseRound courseRound);

    /**
     * 
     * @param batchCourseware
     * @return
     */
    public Dietary generallyLoadDietary(BatchCourseware batchCourseware);

    /**
     * 
     * @param batchCourseware
     * @return
     */
    public Dietary loadDietary(BatchCourseware batchCourseware);

    /**
     * 
     * @param courseRound
     * @param week
     * @return
     */
    public BatchCourseware loadBatchCourseware(CourseRound courseRound, int week);

    /**
     * 
     * @param batchCourseware
     * @return
     */
    public Exercise loadExercise(BatchCourseware batchCourseware);

    /**
     * 
     * @param courseRound
     * @return
     */
    public ResultReport loadResultReport(CourseRound courseRound);

    /**
     * 
     * @param courseRound
     * @param summary
     * @param wordsToCoach
     */
    public void editResultReportSummary(CourseRound courseRound, String summary, String wordsToCoach);

    /**
     * 年卡-课程课件
     * @param courseRound
     * @return
     */
    public BatchCourseware loadBatchCourseware(CourseRound courseRound);

    /**
     * 
     * @param dailyCourseware
     * @return
     */
    public List<Courseware> listCourseware(DailyCourseware dailyCourseware);

    /**
     * 
     * @param batchCourseware
     * @return
     */
    public List<Map<String, Object>> listPlannedSchedule(BatchCourseware batchCourseware);

    /**
     * 
     * @param courseRound
     * @return
     */
    public int getMaxFinishedCourseCourseware(CourseRound courseRound);

    /**
     * 
     * @param courseRound
     * @return
     */
    public int getMaxFinishedWeeklyPlan(CourseRound courseRound);

    /**
     * 
     * @param coach
     * @return
     */
    public List<CourseRound> listGrouping(Principal coach);

    /**
     * 
     * @param coach
     * @param status
     * @return
     */
    public List<Map<String, Object>> listCourseRound(Principal coach, String status);

    /**
     * 
     * @param courseRound
     * @param basicData
     * @param postureJoint
     */
    public void createStudentAssessment(CourseRound courseRound, BasicData basicData, PostureJoint postureJoint);

    /**
     * 
     * @param courseRound
     * @return
     */
    public List<FitnessGroup> listFitnessGroup(CourseRound courseRound);

    /**
     * 
     * @param tagIds
     * @return
     */
    public List<Map<String, Object>> listStudentTags(List<Long> tagIds);

    /**
     * 
     * @param fitnessGroupId
     * @return
     */
    public FitnessGroup loadFitnessGroup(Long fitnessGroupId);

    /**
     * 
     * @param courseRound
     * @param fitnessGroup
     * @param tagIds
     */
    public void editFitnessGroup(CourseRound courseRound, FitnessGroup fitnessGroup, List<Long> tagIds);

    /**
     * 
     * @param student
     * @return
     */
    public Map<String, Object> getStudentTags(Student student);

    /**
     * 
     * @param type
     * @return
     */
    public List<DietaryProgramTemplate> listDietaryTemplate(DietaryProgramType type);

    /**
     * 
     * @param batchCourseware
     * @param dietary
     */
    public void editDietary(BatchCourseware batchCourseware, DietaryRequest dietary);

    /**
     * 
     * @param batchCourseware
     * @param exercise
     */
    public void editExercise(BatchCourseware batchCourseware, ExerciseRequest exercise);

    /**
     * 
     * @param batchCourseware
     */
    public void send(BatchCourseware batchCourseware);

    /**
     * 
     * @param courseRound
     * @return
     */
    public List<CourseSchedule> generallyListScheduleCourseware(CourseRound courseRound);

    /**
     * 初始化上课内容为原课程课件上课内容
     * @param courseSchedule
     */
    public void initlizeContent(CourseSchedule courseSchedule);

    /**
     * 
     * @param courseSchedule
     * @return
     */
    public List<Map<String, Object>> getContent(CourseSchedule courseSchedule);

    /**
     * 
     * @param courseSchedule
     * @param contents
     */
    public void editContent(CourseSchedule courseSchedule, List<ExerciseContent> contents);

    /**
     * 
     * @param courseSchedule
     * @param movementIds
     */
    public void addCourseware(CourseSchedule courseSchedule, List<Long> movementIds);

    /**
     * 
     * @param courseSchedule
     * @param fitnessGroup
     */
    public void addCourseware(CourseSchedule courseSchedule, FitnessGroup fitnessGroup);

    /**
     * 
     * @param courseSchedule
     * @param coursewareIds
     */
    public void deleteCourseware(CourseSchedule courseSchedule, List<Long> coursewareIds);

    /**
     * 
     * @param courseSchedule
     * @param coursewares
     */
    public void editCourseware(CourseSchedule courseSchedule, List<CoursewareRequest> coursewares);

    /**
     * 
     * @param courseRound
     * @param week
     * @return
     */
    public Map<String, Date> getWeekBeginAndEnd(CourseRound courseRound, int week);
}
